package com.chen.service;

import com.chen.bean.User;
import com.chen.dao.UserMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserService {

    @Resource
    UserMapper userMapper;

    public User getUser(String username){
        return userMapper.getUserByName(username);
    }

    public void addUser(User user){
        userMapper.insertUser(user);
    }

    public void updatePassword(User user){
        userMapper.updatePassword(user);
    }

    public User getUserByTitle(String title) {
        return userMapper.getUserByTitle(title);
    }

    public void addAvatar(String url,String username){
        userMapper.insertAvatar(url,username);
    }
}
